package com.aaa.controller;

import com.aaa.entity.Dynasty;
import com.aaa.service.DynastyService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/dynasty")
public class DynastyController {

    @Autowired
    DynastyService ds;

    @RequestMapping("findDynasty")
    public PageInfo findDynasty(String dynName, int page, int size){
        return ds.findDynasty(dynName,page,size);
    }

    @RequestMapping("findAllDynasty")
    public List<Dynasty> findAllDynasty(){
        return ds.findAllDynasty();
    }
}
